package com.changgou.order.listener;

import com.changgou.order.service.OrderService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author wz
 * @company 公司
 * @create 2020-04-15 16:32
 */
@Component
public class orderTaskListener {

    @Autowired
    private OrderService orderService;
    @RabbitListener(queues = "order_task")
    public void autoTask(String message){
        System.out.println("收到自动确认收货的消息");
        orderService.autoTask(); //自动确认收货
    }
}
